package com.thb.pay.api.agent.fallback;

import com.thb.pay.api.agent.AgentPassageServiceApi;
import com.thb.pay.api.agent.vo.req.AgentPassageReq;
import com.thb.pay.api.agent.vo.resp.AgentPassageVo;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Slf4j
@Component
public class AgentPassageServiceApiFallbackFactory implements FallbackFactory<AgentPassageServiceApi> {


    @Override
    public AgentPassageServiceApi create(Throwable throwable) {
        return new AgentPassageServiceApi() {

            @Override
            public List<AgentPassageVo> findListByAgentId(Long agentId) {
                return null;
            }

            @Override
            public AgentPassageVo getByAgentIdAndProductId(@RequestParam("agentId") Long agentId, @RequestParam("productId") Long productId) {
                return null;
            }

            @Override
            public void addOrUpdate(@RequestBody AgentPassageReq agentPassageReq) {

            }
        };
    }
}